package ui;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JButton;

import logic.ACListAdmin;



public class AdminCreateUser extends JPanel {
	private JTextField frmFirstName;
	private JTextField frmLastName;
	private JTextField frmEmail;
	private JTextField frmYear;
	private JTextField frmPhone;
	JButton btnCreateUser;

	/**
	 * Create the panel.
	 */
	public AdminCreateUser() {
		
		setBackground(Color.decode("#FFFFFF"));
		setLayout(null);
		
	    ImageIcon adminPanelGradient = new ImageIcon("gfx/adminPanelGradient.png");

		JLabel topPanel = new JLabel(adminPanelGradient);	
		topPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.decode("#CCCCCC")));
		topPanel.setBounds(0, 0, 650, 80);
		
		JLabel panelTitle = new JLabel("Create User");
		panelTitle.setBounds(10, 35, 650, 50);
		panelTitle.setFont(new Font("Helvetica Neue", Font.PLAIN, 28));

		// CREATE USER FORM		
		JLabel lblFirstName = new JLabel("First Name");
		lblFirstName.setBounds(10, 100, 300, 30);
		
		frmFirstName = new JTextField();
		frmFirstName.setBounds(10, 120, 300, 30);
		
		JLabel lblLastName = new JLabel("Last Name");
		lblLastName.setBounds(10, 160, 300, 30);
		
		frmLastName = new JTextField();
		frmLastName.setBounds(10, 180, 300, 30);
		
		JLabel lblEmail = new JLabel("Email");
		lblEmail.setBounds(10, 220, 300, 30);
		
		frmEmail = new JTextField();
		frmEmail.setBounds(10, 240, 300, 30);
		
		JLabel lblYear = new JLabel("Enroll Year");
		lblYear.setBounds(10, 280, 300, 30);
		
		frmYear = new JTextField();
		frmYear.setColumns(10);
		frmYear.setBounds(10, 300, 145, 30);
		
		JLabel lblPhone = new JLabel("Phone");
		lblPhone.setBounds(165, 280, 140, 30);
		
		frmPhone = new JTextField();
		frmPhone.setBounds(165, 300, 145, 30);
		
		btnCreateUser = new JButton("Create User");
		btnCreateUser.setBounds(10, 340, 120, 30);
		btnCreateUser.setActionCommand("CreateUser");
				
		// ADDING ELEMENTS
		add(panelTitle);
		add(topPanel);
		add(lblFirstName);
		add(frmFirstName);
		add(lblLastName);
		add(lblEmail);
		add(frmLastName);
		add(frmEmail);
		add(lblYear);
		add(frmYear);
		add(lblPhone);
		add(frmPhone);
		add(btnCreateUser);
		
		
		
		
	}

	public JTextField getFrmFirstName() {
		return frmFirstName;
	}

	public JTextField getFrmLastName() {
		return frmLastName;
	}

	public JTextField getFrmEmail() {
		return frmEmail;
	}

	public JTextField getFrmYear() {
		return frmYear;
	}

	public JTextField getFrmPhone() {
		return frmPhone;
	}

	public void addACList (ActionListener ac){
		btnCreateUser.addActionListener(ac);
	}
}
